﻿/*----------------------------------------------------------------
//  <copyright file="WeChatDefaults.cs" company="MicroCloud@151504200868">
//      Copyright © 2020-2024 MicroCloud Corporation, All rights reserved.
//  </copyright>
//  <site>https://gitee.com/chenmm123/microclouds</site>
//  <last-editor>cmm</last-editor>
//  <last-date>2022-11-15 14:42</last-date>
//----------------------------------------------------------------*/

namespace MicroCloud.Authentication.OAuth2.WeChat
{
    #region "微信认证使用的默认值"
    /// <summary>
    /// 微信认证使用的默认值
    /// https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html 
    /// 网站应用微信登录开发指南 文档
    /// </summary>
    public static class WeChatDefaults
    {
        /// <summary>
        /// 权限标记
        /// <see cref="AuthenticationOptions.DefaultAuthenticateScheme"/>
        /// </summary>
        public const string AuthenticationScheme = "WeChat";

        /// <summary>
        /// 显示名称
        /// </summary>
        public const string DisplayName = "微信";

        /// <summary>
        /// 应用程序基本路径中的请求路径，用户代理将在其中返回。中间件将在该请求到达时处理它。
        /// <see cref="RemoteAuthenticationOptions.CallbackPath"/>
        /// </summary>
        public const string CallbackPath = "/signin-weixin";

        /// <summary>
        /// 应用于创建的任何声明的颁发者
        /// <see cref="AuthenticationSchemeOptions.ClaimsIssuer"/>
        /// </summary>
        public const string Issuer = "wechat";

        /// <summary>
        /// 基本授权作用域
        /// </summary>
        public const string snsapi_base = "snsapi_base";

        /// <summary>
        /// 登录授权作用域
        /// </summary>
        public const string snsapi_login = "snsapi_login";

        /// <summary>
        /// 获取用户个人信息授权作用域
        /// </summary>
        public const string snsapi_userinfo = "snsapi_userinfo";

        /// <summary>
        /// 获取Authorization Code
        /// scope=snsapi_login
        /// <see cref="OAuthOptions.AuthorizationEndpoint"/>
        /// </summary>
        public const string AuthorizationEndpoint = "https://open.weixin.qq.com/connect/qrconnect";

        /// <summary>
        /// 通过Authorization Code获取Access Token、Refresh Token
        /// scope=snsapi_base
        /// <see cref="OAuthOptions.TokenEndpoint"/>
        /// </summary>
        public const string TokenEndpoint = "https://api.weixin.qq.com/sns/oauth2/access_token";

        /// <summary>
        /// 通过Refresh Token获取Access Token
        /// scope=snsapi_base
        /// </summary>
        public const string RefreshTokenEndpoint = "https://api.weixin.qq.com/sns/oauth2/refresh_token";

        /// <summary>
        /// 检查access_token有效性
        /// scope=snsapi_base
        /// </summary>
        public const string CheckAuthEndpoint = "https://api.weixin.qq.com/sns/auth";

        /// <summary>
        /// 获取用户个人信息
        /// scope=snsapi_userinfo
        /// <see cref="OAuthOptions.UserInformationEndpoint"/>
        /// </summary>
        public const string UserInformationEndpoint = "https://api.weixin.qq.com/sns/userinfo";


    }
    #endregion

}
